package com.hnx.admin.system.service.impl;

import com.hnx.admin.api.param.ParamValidator;
import com.hnx.admin.json.BaseForm;
import com.hnx.admin.jwt.JwtUtil;
import com.hnx.admin.redis.RedisCache;
import org.springframework.stereotype.Component;

/*
项目名称： core
创 建 人: 倔强的头发
创建日期： 2025/6/9   17:00:59 
描   述：
*/
@Component
public record ParamValidatorImpl(JwtUtil jwtUtil, RedisCache redisCache) implements ParamValidator {
    @Override
    public void setParam(BaseForm baseForm) {
//        HttpServletRequest request = ServletUtil.getRequest();
//        String userKey = jwtUtil.getUserKey(request);
//        UserDetailVO userDetailVO = redisCache.getCacheObject(userKey, UserDetailVO.class);
//        if(Objects.nonNull(userDetailVO)) {
//            EmpDTO emp = userDetailVO.getUserVO().getEmp();
//            baseForm.setDeptId(emp.getDeptId());
//            baseForm.setUserId(emp.getUserId());
//        }
    }
}
